          
          
          //导航栏是否展开
          var flip = false;
          var mainNavLeave = false;
          var sonNavLeave = false;
          
          var linkJumpCount = 3;
          var linkHref;
          var beginningDelay = 0;
          var animateDelayCount = 0;
          //var watchBrowse = null;
          function countDown(){
                linkJumpCount -= 1;
               
                //linkJumpCount=0时，跳转页面
                if(linkJumpCount <= 0){
                    location.href = linkHref;
                }

                //每秒执行一次,showTime()
                setTimeout("countDown()",1000);
            }
            
            function changeBtnTip(){
                flip = !flip; 
                if(!flip){
                    $('header .sonMenuPalace').removeClass('show');
                    if($('header .sonMenuPalace nav').html()){
                        $('header .navSide>nav>div.over .sonMenu').append($('header .sonMenuPalace nav a'));
                    }
                    $('header .navSide>nav>div').removeClass('over');
                }
                if($('header .navSide')[0].className.indexOf('menu') >= 0){
                    $('header .navSide').removeClass('menu');
                    $('header .navSide').addClass('back');
                }else{
                    $('header .navSide').removeClass('back');
                    $('header .navSide').addClass('menu');
                }
            }
            //判断是否为移动设备
            function browserRedirect(){
                var sUserAgent = navigator.userAgent.toLowerCase();
                var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
                var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
                var bIsMidp = sUserAgent.match(/midp/i) == "midp";
                var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
                var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
                var bIsAndroid = sUserAgent.match(/android/i) == "android";
                var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
                var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
                if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                    $('body').addClass('mobileDevice');
                    return true;
                }else{
                    return false;
                }
            }
            $(document).ready(function(){
                browserRedirect(); 
                console.log($('.mobileDevice').length);
                if(window.history.length == 1 || window.performance.navigation.type == 1){
                    setTimeout(function(){
                        $('body').css('overflow-y','auto');
                    },2000);
                    $('.beginning').addClass('first');
                }else{  
                    $('.beginning').addClass('basic');
                    $('.beginning').addClass('enter');
                    setTimeout(function(){
                        $('body').css('overflow-y','auto');
                    },990);
                }
                
                
                $('a').click(function(e){
                       
                        linkHref = $(this).attr('href');
                        e = e || window.event;
                        e.cancelBubble = true;
                        e.stopPropagation();
                        if(e.preventDefault){ // w3c
                            e.preventDefault();
                        } else { // ie
                            e.returnValue = false;
                        }
                        if((!$(this).siblings('.sonMenu').length && $('.mobileDevice').length) || !$('.mobileDevice').length){
                            console.log('time');
                            $('.beginning').addClass('leave');
                            setTimeout(function(){
                                $('body').css('overflow-y','hidden');
                            },990);
                            countDown();
                        }
                })
                /*$('*').click(function(ev){
                    var oEvent = ev || event;
                    oEvent.cancelBubble = true;
                    oEvent.stopPropagation();
                    if($(this)[0] != $('header .navSide .navBtn')[0] || $(this)[0] != $('header')[0] || !$(this).parents('.navBtn').length){
                        if(!$(this).parents('header').length){
                            if($('header .navSide.back').length){
                                $('header .navSide .navBtn *').click();
                            }
                        }
                    }
                })*/
                $('header .navSide .navBtn').click(function(){
                        changeBtnTip();
                })
                $('header .navSide>nav>div').mouseenter(function(){
                    if($('.mobileDevice').length) return false;
                    if($(this).find('.sonMenu').length){
                        if($('header .sonMenuPalace nav').html()){
                            $('header .navSide>nav>div.over .sonMenu').append($('header .sonMenuPalace nav a'));
                        }
                        $('header .sonMenuPalace nav').append($(this).find('.sonMenu a'));
                        if($('header .sonMenuPalace')[0].className.indexOf('show') < 0){
                            $('header .sonMenuPalace').addClass('show');
                        }      
                    }else{
                        if($('header .sonMenuPalace nav').html()){
                            $('header .navSide>nav>div.over .sonMenu').append($('header .sonMenuPalace nav a'));
                        }
                        if($('header .sonMenuPalace')[0].className.indexOf('show') >= 0){
                            $('header .sonMenuPalace').removeClass('show');
                        }
                    }
                    $('header .navSide>nav>div').removeClass('over');
                    $(this).addClass('over');    
                })
                $('header .navSide>nav').mouseenter(function(){
                    if($('.mobileDevice').length) return false;
                    mainNavLeave = false;
                    sonNavLeave = true
                })
                $('header .sonMenuPalace').mouseenter(function(){
                    mainNavLeave = true;
                    sonNavLeave = false;
                })
                $('header .sonMenuPalace').mouseleave(function(){
                    if($('.mobileDevice').length) return false;
                    sonNavLeave = true;
                    setTimeout(function(){
                        if(mainNavLeave && sonNavLeave){
                            if($('header .sonMenuPalace nav').html()){
                                $('header .navSide>nav>div.over .sonMenu').append($('header .sonMenuPalace nav a'));
                            }
                            $('header .sonMenuPalace').removeClass('show');
                            $('header .navSide>nav>div').removeClass('over');

                        }
                    },10)
                    
                })
                $('header .navSide>nav>div>a').click(function(){
                    if($(this).siblings('.sonMenu').length){
                        if($('header .sonMenuPalace nav').html()){
                            $('header .navSide>nav>div.over .sonMenu').append($('header .sonMenuPalace nav a'));
                        }
                        $('header .sonMenuPalace nav').append($(this).next().find('a'));
                        if($('header .sonMenuPalace')[0].className.indexOf('show') < 0){
                            $('header .sonMenuPalace').addClass('show');
                        }
                    }else{
                        $('header .sonMenuPalace').removeClass('show');
                    }
                    $('header .navSide>nav>div').removeClass('over');
                    $(this).parent().addClass('over');
                })
               
            })

            

        